<template>
  <MyInput v-model="msg" :placeholder="inputObj.placeholder" :maxlength="inputObj.maxLength" @change="inputChange" />
  <button @click="changeMsg">changeMsg</button>
</template>

<script setup name="App">
import { reactive, ref, watchEffect } from 'vue'
import MyInput from './components/MyInput'

const msg = ref('')
const inputObj = reactive({
  placeholder: '请输入内容',
  maxLength: 10
})

watchEffect(() => {
  console.log(msg.value, 'msg');
})

function changeMsg() {
  inputObj.placeholder = '快速...'
  inputObj.maxLength = 15
}

function inputChange(e) {
  console.log(e.target.value, '=====');
}
</script>

<style>
</style>
